<template>
  <div class="hello">
   <h1>list</h1>
   <router-link to="/list/one">one</router-link>||
   <router-view />
   <button @click="test">xxx</button>
  </div>
</template>

<script>
export default {
  created(){
    console.log("run_list");
  },
  methods:{
    test(){
      this.$eventBus.$emit("testEvent",{uname : "yuxia"});
    }
  },
    beforeRouteEnter(to, from, next) {
    // if(from.path == "/test"){
    //       next({path:"/index"});
    // }else{
       next();
    // }
    
  },
  // 路由离开
  beforeRouteLeave(to, from, next) {
    next();
  },
beforeRouterUpdate(to,form,next){
  next();
}
};
</script>


